package com.ss.android.article.base.feature.video.cdn.data;

import android.net.Uri;
import android.text.TextUtils;
import java.util.ArrayList;
import java.util.Iterator;

public class SSCdnHostItem {
    public String cdnDomain;
    public long cdnGetIPCostTime;
    public ArrayList cdnIPArrayList;
    public int cdnRank;
    public String cdnUrl;

    public SSCdnHostItem() {

        this.cdnRank = 500;
        this.cdnUrl = null;
        this.cdnDomain = null;
        this.cdnGetIPCostTime = 0;
        this.cdnIPArrayList = null;
    }

    public void parseCdnUrl(String arg2) {
        if(!TextUtils.isEmpty(((CharSequence)arg2))) {
            this.cdnUrl = arg2;
            this.cdnDomain = Uri.parse(arg2).getHost();
        }
    }

    public void setHostRank() {
        if(this.cdnIPArrayList == null || this.cdnIPArrayList.size() == 0) {
            this.cdnRank = 500;
        }
        else {
            Iterator v2 = this.cdnIPArrayList.iterator();
            int v1;
            for(v1 = 0; v2.hasNext(); v1 = ((SSCdnIpItem)v2.next()).ipRank + v1) {
            }

            this.cdnRank = v1 / this.cdnIPArrayList.size();
        }
    }
}

